<template>
{{#if ctrl.psSysPFPlugin}}
    {{> @macro/plugins/widget/widget-use.hbs appPlugin=ctrl.psSysPFPlugin}}
{{else}}
    <div :class="classNames">
        <van-tabs v-model:active="store.activeKey" :lazy-render="false" @click-tab="(event) => { handleTabPanelClick(controller, event) }" ref="tabs" class="app-mob-van-tabs">
        {{#each ctrl.ctrls as | ctrl |}}
        {{#eq controlType 'TABVIEWPANEL'}}
            {{> @macro/widgets/tab-view-panel-detail/tab-view-panel.hbs ctrl=ctrl}}
        {{/eq}}
        {{/each}}
        </van-tabs>
  </div>
{{/if}}
</template>

// 基于template/src/widgets/\{{appEntities}}/\{{ctrls@TABEXPPANEL}}-tab-exp-panel/\{{spinalCase ctrl.codeName}}-tab-exp-panel.vue.hbs生成
<script setup lang="ts">
{{> @macro/plugins/widget/widget-import.hbs ctrl=ctrl}}
{{#ctrl.ctrls}}
  {{#eq controlType 'TABVIEWPANEL'}}
import {{codeName}}TabViewPanel from '@widgets/{{spinalCase appEntity.codeName}}/{{spinalCase codeName}}-tab-view-panel/{{spinalCase codeName}}-tab-view-panel.vue';
  {{/eq}}
{{/ctrl.ctrls}}
import { model } from "./{{spinalCase ctrl.codeName}}-tab-exp-panel-model";
import { IContext, IParam, TabExpPanelController, TabExpPanelActionType, ITabExpPanelAbility, ITabExpPanelControllerParams, ITabExpPanelStore, ITabExpPanelController, ILoadingHelper, IViewCtx } from "@/core";
import { getCtrlClassNames, useEventBind, useNavParamsBind, handleCtrlDestroy, handleCtrlInit, handleCtrlAction, handleTabPanelClick } from "@/hooks/use-ctrl";

{{> @macro/widgets/ctrl/ctrl-props.hbs}}

{{> @macro/common/emit.hbs name="ctrl" actionType="TabExpPanelActionType" ability="ITabExpPanelAbility"}}

//  部件样式名
const classNames = computed(() => {
  return getCtrlClassNames(model, props);
});

const tabs = ref();
const params: ITabExpPanelControllerParams<TabExpPanelActionType, ITabExpPanelAbility> = {
    name: props.name,
    model,
    evt,
    actions: {},
    closeView: props.closeView,
    pLoadingHelper: props.pLoadingHelper,
    handler: (data: ITabExpPanelStore) => { return reactive(data); }
};
{{> @macro/common/controller.hbs name="ctrl" IController="ITabExpPanelController" store="ITabExpPanelStore" ability="ITabExpPanelAbility" controller="TabExpPanelController"}}

</script>
